<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

<div id="app">
    <div>{{info.name}}</div>
    <div>{{info.url}}</div>
    <div>{{info.address.country}}</div>
    <ul>
        <li v-for="link in info.links">
            {{link.name}}--{{link.url}}
        </li>
    </ul>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: '#app',
        data(){
            return {
                info: {
                    name: '',
                    url: '',
                    address: {
                        street: '',
                        city: '',
                        country: ''
                    },
                    links:[]
                }
            }
        },
        //此方法在页面初始化完成后就会执行
        mounted(){
            axios.get('data.json').then(response => (this.info = response.data));
        }
    });
</script>
</body>
</html>